#include <sphere.h>

sphere_t *
sphere_new( void ){
  return calloc( 1, sizeof( sphere_t ) );
}

void
sphere_free( sphere_t *sphere ){
  assert( sphere != NULL );
  free( sphere );
}

char *
sphere_str( sphere_t *sphere ){
  char *s = NULL;

  asprintf( &s, "sphere : center at ( %f, %f, %f ) radius = %d",
	    VECTOR3_X( sphere->center ),
	    VECTOR3_Y( sphere->center ),
	    VECTOR3_Z( sphere->center ),
	    sphere->radius
	    );

  return s;
}

